#ifndef keypad_h
#define keypad_h

#define KEY_NUMBER 4
extern char keymap[KEY_NUMBER];

#define keyClick(iKey) (keymap[iKey]&1)
#define keyHold(iKey) (keymap[iKey])
#define keyDown(iKey) ((keymap[iKey]&3)==3)
#define keyDblClick(iKey) (keymap[iKey]==7)

#define KEY_FILTER 12
#define KEY_PAUSE_LONG 50
#define KEY_PAUSE_SHORT 4
#define KEY_DBLCLICK_DELAY_MAX 20
#define KEY_DBLCLICK_DELAY_MIN 0

#define KEY_NEXT 0
#define KEY_PREV 1
#define KEY_PLUS 2
#define KEY_MINUS 3
unsigned char keyFilter(void);
#endif
